using System;
using System.Collections.Generic;
using System.Text;
using SDMX_Common = SDMX_ML.Framework.Common;

namespace SDMX_ML.Framework.Structure
{
    public class ConceptType
    {
        private List<SDMX_Common.TextType> _name;
        private List<SDMX_Common.TextType> _description;
        private SDMX_Common.AnnotationsType _annotations;

        
        private TextFormatType _textformat;
        private SDMX_Common.IDType _id;
        private SDMX_Common.IDType _agencyid;
        private string _version;
        private string _uri;
        private string _urn;
        private bool? _isExternalReference;
        private SDMX_Common.IDType _coreRepresentation;

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name">Name of concept.</param>
        /// <param name="id">ID of the concept.</param>
        public ConceptType(SDMX_Common.TextType name, SDMX_Common.IDType id)
        {
            if (name != null & id != null)
            {
                _name = new List<SDMX_Common.TextType>();
                _description = new List<SDMX_Common.TextType>();
                _name.Add(name);
                _id = id;
            }
            else
            {
                throw new Exception("Name and id are required fields in concepttype!");
            }
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name">Name of concept Default language is english..</param>
        /// <param name="id">ID of the concept.</param>
        public ConceptType(string name, string id)
        {
            if (!String.IsNullOrEmpty(name) & !String.IsNullOrEmpty(id))
            {
                _name = new List<SDMX_Common.TextType>();
                _description = new List<SDMX_Common.TextType>();

                SDMX_Common.TextType conceptName = new SDMX_Common.TextType(name);
                _name.Add(conceptName);
                SDMX_Common.IDType conceptID = new SDMX_Common.IDType(id);
                _id = conceptID;
            }
            else
            {
                throw new Exception("Name and id are required fields in concepttype!");
            }
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name">Name of concept.</param>
        /// <param name="language">Language used for the name in the format en, dk, us etc.</param>
        /// <param name="id">ID of the concept.</param>
        public ConceptType(string name, string language, string id)
        {
            if (!String.IsNullOrEmpty(name) & !String.IsNullOrEmpty(id) & !String.IsNullOrEmpty(language))
            {
                _name = new List<SDMX_Common.TextType>();
                _description = new List<SDMX_Common.TextType>();

                SDMX_Common.TextType conceptName = new SDMX_Common.TextType(name, language);
                _name.Add(conceptName);
                SDMX_Common.IDType conceptID = new SDMX_Common.IDType(id);
                _id = conceptID;
            }
            else
            {
                throw new Exception("Name and id are required fields in concepttype!");
            }
        }

        public SDMX_Common.IDType CoreRepresentation
        {
            get { return _coreRepresentation; }
            set { _coreRepresentation = value; }
        }
        private SDMX_Common.IDType _coreReprensentationAgency;

        public SDMX_Common.IDType CoreReprensentationAgency
        {
            get { return _coreReprensentationAgency; }
            set { _coreReprensentationAgency = value; }
        }
        private SDMX_Common.IDType _parent;

        public SDMX_Common.IDType Parent
        {
            get { return _parent; }
            set { _parent = value; }
        }
        private SDMX_Common.IDType _parentAgency;

        public SDMX_Common.IDType ParentAgency
        {
            get { return _parentAgency; }
            set { _parentAgency = value; }
        }

        public bool? IsExternalReference
        {
            get { return _isExternalReference; }
            set { _isExternalReference = value; }
        }

        public SDMX_Common.AnnotationsType Annotations
        {
            get { return _annotations; }
            set { _annotations = value; }
        }

        public List<SDMX_Common.TextType> Description
        {
            get { return _description; }
            set { _description = value; }
        }
        

        public TextFormatType Textformat
        {
            get { return _textformat; }
            set { _textformat = value; }
        }
        

        public SDMX_Common.IDType ID
        {
            get { return _id; }
            set { _id = value; }
        }
        

        public SDMX_Common.IDType AgencyID
        {
            get { return _agencyid; }
            set { _agencyid = value; }
        }
        

        public string Version
        {
            get { return _version; }
            set { _version = value; }
        }
        

        public string Uri
        {
            get { return _uri; }
            set { _uri = value; }
        }
        

        public string Urn
        {
            get { return _urn; }
            set { _urn = value; }
        }

        public List<SDMX_Common.TextType> Name
        {
            get { return _name; }
            set { _name = value; }
        }


    }
}
